home *** CD-ROM | disk | FTP | other *** search
/ Business Assistant / Business Assistant.iso / indus / rental / report.prg < prev    next >
Text File  |  1986-08-09  |  19KB  |  699 lines

  1. **    Last revision: May 26, 1986 at 15:30
  2. * report.prg
  3. STOR .t. TO more
  4. DO WHIL more
  5.  STOR 'Y' TO printer
  6.  STOR 'N' TO disk
  7.  STOR '        ' TO filename
  8.  STOR '?' TO command
  9.  CLEA
  10.  IF clipper
  11.   @ 0,0, 22, 79 BOX frame
  12.   @ 4,1 SAY line1
  13.   @ 19,1 SAY line1
  14.  ELSE
  15.   @ 0,0 TO 4,79
  16.   @ 0,0 TO 19,79
  17.   @ 0,0 TO 22,79 DOUBLE
  18.  ENDI
  19.  @ 20,5 SAY 'Please select one of the above options. You may also leave this menu'
  20.  @ 21,5 SAY "by typing 'Q' and get on-line HELP by typing '?'."
  21.  @ 2,04 SAY dconame + " -  BUILDING REPORT MENU"
  22.  @ 2,65 SAY DTOC(DATE())
  23.  @ 7,29 SAY "A. Rent bills"
  24.  @ 8,29 SAY "B. Tenant roster"
  25.  @ 9,29 SAY "C. Delinquency report"
  26.  @ 10,29 SAY "D. Tenant mailing labels"
  27.  @ 11,29 SAY "E. Vacancy list"
  28.  @ 12,29 SAY "F. Lease expiration and flag report"
  29.  @ 13,29 SAY "G. Return to Main Menu"
  30.  @ 15,23 SAY "PLEASE SELECT ONE OF THE OPTIONS"
  31.  @ 15,58 GET command PICTURE '!'
  32.  READ
  33.  DO WHIL AT(COMMAND, 'ABCDEFG?Q') = 0
  34.   STOR '?' TO command
  35.   @ 15,58 GET command PICTURE '!'
  36.   READ
  37.  ENDD
  38.  CLEA GETS
  39.  IF command >='B' .AND. command <  'G'
  40.   @ 17,01 SAY "         Send Report to the Printer (Y/N)"
  41.   @ 17,55 GET printer PICTURE '!'
  42.   READ
  43.   @ 18,01 SAY "         Send Report  to a Disk File (Y/N)"
  44.   @ 18,55 GET disk PICTURE '!'
  45.   READ
  46.   IF disk ='Y'
  47.    @ 17,01 SAY SPACE(75)
  48.    @ 18,01 SAY SPACE(75)
  49.    @ 17,01 SAY "          Enter Disk File Name"
  50.    @ 17,34 GET filename PICTURE '!!!!!!!!'
  51.    @ 17,44 SAY "(.TXT will be added )"
  52.    READ
  53.    @ 18,01 SAY '          Select drive to put Files on'
  54.    @ 18,55 GET dr PICTURE '!'
  55.    READ
  56.    DO WHIL AT(dr,'ABCD') = 0
  57.     @ 18,55 GET dr PICTURE '!'
  58.     READ
  59.    ENDD while @
  60.   ENDI disk = Y
  61.   STOR LEN(dconame)/2  TO L
  62.   STOR 40-L TO L
  63.   STOR '                                        ' TO bl
  64.   STOR SUBSTR(bl,1,L) + dconame TO coname
  65.   IF printer = 'Y'
  66.    @ 17,01 SAY SPACE(75)
  67.    @ 18,01 SAY SPACE(75)
  68.    @ 17,01 SAY '          MAKE PRINTER READY AND HIT ANY KEY'
  69.    SET CONSOLE OFF
  70.    WAIT
  71.    SET CONSOLE ON
  72.    SET print ON
  73.   ENDI printer = Y
  74.   IF disk = 'Y' .AND. filename <> ' '
  75. * make a proper REPORT file name that is of type TXT
  76.    STOR AT('.',filename) TO length
  77.    IF length = 0 .OR. length > 8
  78.     STOR 9 TO length
  79.    ENDI length
  80.    STOR SUBSTR(filename,1,length-1) TO filename
  81.    STOR '&dr.:'+filename+'.TXT' TO filename
  82.    SET ALTERNATE TO &filename
  83.    SET ALTERNATE ON
  84.   ENDI disk = Y and filename <> ''
  85.  ENDI command
  86.  CLEA
  87.  DO CASE
  88.  CASE command = 'A'
  89.   SET PRINT OFF
  90. * rent bills
  91.   SELE A
  92.   USE &dr.:build
  93.   SET INDEX TO &dr.:code
  94.   CLEA
  95.   TEXT
  96.  
  97.                  This module prepares the rent bills. If the
  98.                  rents for the month have not been posted and
  99.                  the new rents not accrued please take care of
  100.                  that before you run this program.  
  101.  
  102.                  The form set up is for UARCO C599 and envelope
  103.                  EN81. Form length is 7 inches.      
  104.  
  105.  
  106.  
  107.  
  108.  
  109.  
  110.  
  111.  
  112.  
  113.  
  114.  
  115.  
  116.  
  117.   ENDT
  118.   STOR 'Y' TO comman
  119.   @ 10,20 SAY 'ARE YOU READY TO PROCEED ? '
  120.   @ 10,50 GET comman PICTURE '!'
  121.   READ
  122.   IF COMMAN = 'Y'
  123.    SET confirm on
  124.    STOR '  ' TO build
  125.    @ 12,10 SAY "What building shall we prepare bills for ('99' for all) "
  126.    @ 12,70 GET build PICTURE '99'
  127.    READ
  128.    IF build <> '99'
  129.     SEEK build
  130.     DO WHIL (EOF() .OR. BOF())
  131.      @ 12,70 GET build PICTURE '99'
  132.      READ
  133.      SEEK build
  134.     ENDD WHILE #
  135.    ELSE
  136.     GO TOP
  137.    ENDI build <> '99'
  138.    STOR '         ' TO month
  139.    @ 13,10 SAY "For what month "
  140.    @ 13,40 GET month PICTURE '!XXXXXXXX'
  141.    READ
  142.    @ 16,10 SAY 'Hit any key when the printer is on and the proper paper loaded'
  143.    @ 17,10 SAY 'with the top of the form at the level of the print head.'
  144.    SET CONSOLE OFF
  145.    WAIT
  146.    SET CONSOLE ON
  147.    SET PRINT ON
  148.    CLEA
  149.    STOR .t. TO bigloop
  150.    DO WHIL BIGLOOP .AND.(.NOT. EOF())
  151.     IF build <> '99'
  152.      STOR .f. TO bigloop
  153.     ELSE
  154.      STOR RECNO() TO rec_no
  155.     ENDI build <> '99'
  156.     STOR bcode TO mbcode
  157.     STOR baddr TO mbaddr
  158.     STOR SUBSTR(bcity,1,22) + '  ' + SUBSTR(bcity,23,5) TO mbcity
  159.     STOR remit TO mremit
  160.     STOR remitad TO mremitad
  161.     STOR remitc TO mremitc
  162.     STOR phone TO mphone
  163.     STOR checks TO mchecks
  164.     SELE B
  165.     USE &dr.:tenant
  166.     SET index TO &dr.:codea
  167.     SEEK mbcode
  168.     DO WHIL SUBSTR(bcode,1,2) = mbcode .AND.(.NOT. EOF())
  169.      IF tenant <> ' '
  170.       STOR 0 TO line
  171.       STOR 0 TO mtotal
  172.       STOR trent TO trentx
  173.       IF ttype = 'P'
  174.        IF (trentpc*(trentpcr/100)/12)>trent
  175.         STOR (trentpc*(trentpcr/100)/12) TO trentx
  176.        ENDI (trentpc)
  177.       ENDI ttype = 'P'
  178.       IF ttype = 'O'
  179.        STOR ((trentpc*(trentpcr/100)/12)+trent) TO trentx
  180.       ENDI ttype = 'O'
  181.       ? '   '
  182.       ? '   ' + mremit
  183.       ? '   ' + mremitad
  184.       ? '   ' + mremitc
  185.       ? ' '
  186.       ? ' '
  187.       ? '    PLEASE SEND CHECKS TO ABOVE ADDRESS PAYABLE TO:'
  188.       ? '    ' + mchecks
  189.       ? ' '
  190.       ? ' '
  191.       ? ' '
  192.       ? ' '
  193.       ? '      ' + tenant + '          Unit ' +tunit
  194.       IF alt = 'Y'
  195.        ? '      ' + altad
  196.        ? '      ' + altcty
  197.       ELSE
  198.        ? '      ' + mbaddr
  199.        ? '      ' + mbcity
  200.       ENDI alt
  201.       ? ' '
  202.       ? ' '
  203.       ? '                           R E N T    S T A T E M E N T'
  204.       ? ' '
  205.       ? ' '
  206.       ? '                        Refer inquiries to ' + mphone
  207.       ? ' '
  208.       ? ' '
  209.       IF trentp > 0
  210.        ? '       Paid ' + trentpd + '. THANK YOU                        '+STR(trentp,12,2)
  211.        STOR line + 1 TO line
  212.       ENDI trentp > 0
  213.       ? '       Unpaid balance ' + DTOC(date()) + '                         '+STR(trentd,12,2)
  214.       STOR mtotal + trentd TO mtotal
  215.       ? ' '
  216.       IF ttype = 'P' .OR. ttype = 'O'
  217.        ? '       Base Rent ' + STR(trent,12,2)
  218.       ENDI ttype
  219.       ? '       Base Rent for the month of ' + month + '            '+STR(trentx,12,2)
  220.       STOR mtotal + trentx TO mtotal
  221.       IF trente > 0
  222.        ? '       Electricity                                     '+ STR(trente,12,2)
  223.        STOR mtotal + trente TO mtotal
  224.        STOR line + 1 TO line
  225.       ENDI trente
  226.       IF trentm > 0
  227.        ? '       Miscellaneous charges                           '+STR(trentm,12,2)
  228.        STOR mtotal + trentm TO mtotal
  229.        STOR line + 1 TO line
  230.       ENDI trentm > 0
  231.       IF taddl > 0
  232.        ? '       Additional charges                              '+STR(taddl,12,2)
  233.        STOR mtotal + taddl TO mtotal
  234.        STOR line + 1 TO line
  235.       ENDI taddl >0
  236.       ? ' '
  237.       ? '       TOTAL DUE                                      $'+STR(mtotal,12,2)
  238.       STOR mtotal + tlatec TO mtotal
  239.       ? ' '
  240.       ? ' '
  241.       ? '       AFTER ' + TRIM(UPPER(month)) + ' ' +tlate + ' PAY -   $ '+STR(mtotal,12,2)
  242.       STOR 11- line TO line1
  243.       DO WHIL line1 > 0
  244.        ? ' '
  245.        STOR line1 - 1 TO line1
  246.       ENDD
  247.      ENDI tenant <> ' '
  248.      SKIP
  249.     ENDD WHILE $(bcode)
  250.     SELE A
  251.     USE &dr.:BUILD
  252.     SET INDEX TO &dr.:code
  253.     IF bigloop
  254.      GO rec_no
  255.      SKIP
  256.     ENDI bigloop
  257.    ENDD WHILE .NOT. EOF
  258.   ENDI comman = 'Y'
  259.   IF printer = 'Y'
  260.    EJEC
  261.    SET PRINT OFF
  262.   ENDI
  263.   SET CONFIRM off
  264.   CLEA
  265.   STOR .t. TO more
  266.   STOR 'Y' TO printer
  267.   STOR 'N' TO disk
  268.   STOR '        ' TO filename
  269.   STOR '?' TO select
  270.   SELE A
  271.   USE &dr.:build
  272.   SET INDEX TO &dr.:code
  273.   LOOP
  274.  CASE command = 'B'
  275. * tenant roster
  276.   SELE B
  277.   USE &dr.:tenant
  278.   SET INDEX TO &dr.:codea
  279.   CLEA
  280. * initialize variables
  281.   STOR 0 TO pageno
  282.   STOR 0 TO counter
  283.   STOR 0 TO counter1
  284.   STOR 0 TO additup
  285.   STOR ' ' TO mtenant
  286.   SET MARGIN TO 3
  287.   GO TOP
  288.   STOR .t. TO more1
  289.   DO WHIL more1
  290. * do page counter etc
  291.    STOR pageno + 1 TO pageno
  292.    STOR 4 TO lineno
  293.    CLEA
  294.    ? '  '
  295.    IF pageno = 1
  296.     ? coname
  297.     ? '                                 TENANT REPORT'
  298.     ? ' '
  299.     ? 'Report of ' +DTOC(date()) + '.'
  300.     STOR lineno + 4 TO lineno
  301.    ENDI pageno = 1
  302.    ? '                                                                    ' + 'PAGE ' + STR(pageno,2)
  303.    ? '  Tenant                            ' + 'Code   '+ '   Unit     '